<html>
<meta name=”viewport” content=”width=device-width, initial-scale=1″ />
<head>
    <meta charset="utf-8">
    <title>实名认证未通过审核用户</title>
    <script src="../commonCss.js"></script>
    <script src="../commonJs.js"></script>
    <link rel="stylesheet" href="../../css/common.css">
</head>

<body class="hold-transition skin-blue sidebar-mini">
<section class="content-header">
    <div class="ctc_title">实名认证未通过审核用户</div>
    <div class="down_line"></div>
</section>

<!-- Main content -->
<section class="content" >
    <div class="row">
        <div class="col-xs-12">
            <div class="box-header">
                <form class="form-inline">
                    <div class="form-group">
                        <label>查询：</label>
                        <input style="width: 260px;" class="form-control" type="text" id="searchKey"  placeholder="输入手机号/用户真实姓名搜索"/>
                    </div>
                    <div class="form-group">
                        <button type="button"  onclick="getData()"  class="btn btn-block btn-primary">搜索</button>
                    </div>

                </form>
            </div>

            <div class="box-body" style="height:100%;">
                <table id="dataList" class="table table-bordered table-hover;table-layout:fixed;" >
                    <thead>
                    <tr>
                        <th>用户手机号</th>
                        <th>用户姓名</th>
                        <th>身份证号码</th>
                        <th>活体人脸图片</th>
                        <th>手持身份证图片</th>
                        <th>认证得分</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody >
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</section>

<!-- 【信用扣分申诉处理】弹出窗内容 -->
<div class="modal" id="punishDialog" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true" data-backdrop="static">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">
                    <span aria-hidden="true">×</span>
                    <span class="sr-only">Close</span>
                </button>
                <h4 class="modal-title" align="center" >信用扣分申诉处理</h4>
            </div>
            <div class="modal-body">
                <form class="form-horizontal" onsubmit="return false">
                    <fieldset  style="margin-top: 1%;">
                        <div class="form-group">
                            <input type="hidden" id="appealId"/>
                            <label class="col-md-2 control-label">银行卡号：</label>
                            <div class="col-md-10">
                                <span id="cardNum" class="form-control" style="border: 0px;font-size: 17px;"/>
                            </div>
                            <label class="col-md-2 control-label">账单金额：</label>
                            <div class="col-md-10">
                              <span id="billMoney" class="form-control" style="border: 0px;font-size: 17px;"/>
                            </div>
                            <label class="col-md-2 control-label" >账单截图：</label>
                            <div class="col-md-10">
                                <img id="img" style="border:1px dashed #ddd;width:150px;" onclick="maxPic(this.src)">
                                <img id="img2" style="border:1px dashed #ddd;width:150px;" onclick="maxPic(this.src)">
                                <img id="img3" style="border:1px dashed #ddd;width:150px;" onclick="maxPic(this.src)">
                            </div>
                        </div>
                    </fieldset>
                </form>
            </div>
            <div class="modal-footer" style="text-align: center" id="but_div">
                <button type="button" class="btn btn-primary" onclick="pass();">申诉成功</button>
                <button type="button" class="btn btn-default" onclick="notPass()" >申诉失败</button>
            </div>
        </div>
    </div>
</div>

<!-- 【图片点击放大】弹出窗内容 -->
<div class="modal" id="picMonthDialog" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true" >
    <div class="modal-dialog">
        <div class="modal-content">
            <img id="maxPic" height="50%" width="100%">
        </div>
    </div>
</div>
<!-- page script -->
<script>
    $(document).ready(function() {
        layui.use('layer', function(){
            var layer = layui.layer;
        });
        //加载数据
        getData();
    });
    // 加载数据
    function getData(){
        var table = $('#dataList').DataTable({
            "destroy": true,   //可以重新初始化，用于搜索
            "lengthChange": false,
            "ordering": false,   //排序
            "info": true,		   //
            "autoWidth": false,   //宽度自动
            "paging": true,      //分页
            "searching": false,  //全局搜索关闭
            "processing": true,  //开启显示‘正在加载.../processing’
            "serverSide":true,    //true代表后台处理分页，false代表前台处理分页
            "ajax" :  {
                url:"/user/getNotPass",
                type:"post",
                data:{
                    key : $("#searchKey").val(),
                },
                dataSrc: function (myJson) {
                    return myJson.data.data;
                }
            },
            //参数显示
            "columns": [
                {"data": "mobile", 'sClass': "text-center",'width': '6%'},
                {"data": "partyName", 'sClass': "text-center",'width': '5%'},
                {"data": "idCard", 'sClass': "text-center",'width': '10%'},
                {"data": "faceImg", 'sClass': "text-center",'width': '6%',
                    "render": function ( data, type, full, meta ) {
                        return "<img style='width: 88px;height: 68px; ' src='"+data+"' onclick=maxPic('"+data+"')>";
                    }
                },
                {"data": "faceFailImg", 'sClass': "text-center",'width': '6%',
                    "render": function ( data, type, full, meta ) {
                        return "<img style='width: 88px;height: 68px; ' src='"+data+"' onclick=maxPic('"+data+"')>";
                    }
                },
                {"data": "value", 'sClass': "text-center",'width': '3%'},
                {"data":"id" , 'sClass': "text-center" ,'width':'3%',
                    "render": function (data, type, full, meta ) {
                        var str ="";
                        if(full.status == 0){
                            str += "<a href = '#' title='通过' onclick=checkPass(" + data +");><i class='\glyphicon glyphicon-ok'></i></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
                        }
                        if(full.status == 0){
                            str += "<a href = '#' title='驳回' onclick=checkNotPass("+ data +");><i class='\glyphicon glyphicon-remove'></i></a>&nbsp;";
                        }
                        return str;
                    }
                }
            ],

            //是否开启主题
            "bJQueryUI": true,
            "oLanguage": {    // 语言设置
                "sLengthMenu": "每页显示 _MENU_ 条记录",
                "sZeroRecords": "抱歉， 没有找到",
                "sInfo": "从 _START_ 到 _END_ /共 _TOTAL_ 条数据",
                "sInfoEmpty": "没有数据",
                "sInfoFiltered": "(从 _MAX_ 条数据中检索)",
                "sZeroRecords": "没有检索到数据",
                "sSearch": "检索:",
                "oPaginate": {
                    "sFirst": "首页",
                    "sPrevious": "前一页",
                    "sNext": "后一页",
                    "sLast": "尾页"
                }
            }
        });
    }

    //通过
    function checkPass(id){
       if(confirm("请再次确认用户身份信息！")){
           $.ajax({
               url:"/user/checkUser",
               type:"POST",
               async : true,//默认就是true
               dataType:"json",
               data:{
                   uid : id ,
                   flag : 1   //1：通过,2：未通过，
               },
               success:function(data) {
                   layer.msg(data.message);
                   getData();
               }
           });
       }
    }

    //不通过
    function checkNotPass(id) {
        if(confirm("请再次确认用户身份信息！")){
            $.ajax({
                url:"/user/checkUser",
                type:"POST",
                async : true,//默认就是true
                dataType:"json",
                data:{
                    uid : id ,
                    flag : 2   //1：通过,2：未通过，
                },
                success:function(data) {
                    layer.msg(data.message);
                    getData();
                }
            });
        }

    }

</script>
</body>
</html>
